import http from "../utils/http";

const api = {};

api.obtainUid = function() {
  return http.post({
    url: "./api/v1/uid"
  });
};

api.obtainUser = function(params) {
  return http.get({
    url: "./api/v1/user",
    params: params
  });
};

api.contactPurchase = function(body) {
  return http.post({
    url: "./api/v1/consult",
    data: body
  });
};

api.scanCode = function(params) {
  return http.get({
    url: "./api/scene1/code",
    params: params
  });
};

api.serviceVoucher = function(params) {
  return http.get({
    url: "./api/scene6/code",
    params: params
  });
};

api.codePay = function(params) {
  return http.post({
    url: "./api/scene2/pay",
    params: params
  });
};

api.tradeState = function(params) {
  return http.get({
    url: "./api/scene2/pay/state",
    params: params
  });
};

export default api;
